//
//  SpecialistCollectionCell.m
//  HarmonizePub
//
//  Created by rzhy on 2016/12/20.
//  Copyright © 2016年 Zy. All rights reserved.
//

#import "SpecialistCollectionCell.h"
#import "Config.h"
#import "NSString+Zy.h"

@interface SpecialistCollectionCell ()

@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation SpecialistCollectionCell

+ (NSString *)registerName {
    return @"SpecialistCollectionCell";
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setCellShowDataWithDataDictionary:(NSDictionary *)dataDict {
    NSString *ksmc = [dataDict[@"ksmc"] stringByReplacingOccurrencesOfString:@"（" withString:@"."];
    if (ksmc.length > 5) ksmc = [ksmc stringInterceptWithBegin:0 end:5];
    self.titleLabel.text = ksmc;
    [self setImageWithImageName:dataDict[@"image"]];
}

- (void)setImageWithImageName:(NSString *)imageName {
    [self.imageView downloadImageWithURLString:imageName placeholderString:@"icon.png"];
}

@end
